import request from '@/utils/request'

/**地区下拉 */
export function cityList() {
  return request({
    url: '/distribution/admin/system/city/queryList?level=1',
  })
}


/**派送批次：选择订单批次导入 */
export function googleRouteBatchChooseOrderBatchImport(data) {
  return request({
    url: '/distribution/googleRouteBatch/googleRouteBatchChooseOrderBatchImport',
    method: 'POST',
    data
  })
}

/**自派送批次：选择包裹导入-订单批次列表 */
export function googleRouteBatchChooseOrderBatch(data) {
  return request({
    url: '/distribution/googleRouteBatch/googleRouteBatchChooseOrderBatch',
    method: 'POST',
    data
  })
}


/**选择自派送列表 */
export function googleRouteBatchListStatus1() {
  return request({
    url: '/distribution/googleRouteBatch/list?status=1',
  })
}


/**开始配送 */
export function startShipment(data) {
  return request({
    url: '/distribution/googleRouteBatch/startShipment',
    method: 'POST',
    data
  })
}

/**查询自配送批次路线列表 */
export function googleRouteBatchList(params) {
  return request({
    url: '/distribution/googleRouteBatch/list',
    params
  })
}


/**新增自配送批次路线 */
export function addGoogleRouteBatch(data) {
  return request({
    url: '/distribution/googleRouteBatch',
    method: 'POST',
    data
  })
}


/**删除自配送批次路线 */
export function deleteGoogleRouteBatch(ids) {
  return request({
    url: `/distribution/googleRouteBatch/${ids}`,
    method: 'delete',
  })
}

/**导入包裹 */
export function importPackageByRoute(data) {
  return request({
    url: '/distribution/googleRouteShipments/importPackageByRoute',
    method: 'POST',
    data
  })
}

/**自派送修改批次-查询信息 */
export function getRouteBatchInfo(params) {
  return request({
    url: '/distribution/googleRouteShipments/getRouteBatchInfo',
    params
  })
}


/**计算最优路线*/
export function calRoutePolyline(data) {
  return request({
    url: '/distribution/googleRouteShipments/calRoutePolyline',
    method: 'POST',
    data
  })
}

/**重置航线*/
export function resetRoute(data) {
  return request({
    url: '/distribution/googleRouteShipments/resetRoute',
    method: 'POST',
    data
  })
}


/**自配送批次查询车辆列表*/
export function getVehicleList(params) {
  return request({
    url: '/distribution/googleRouteBatch/getVehicleList',
    params
  })
}


/**查询行程负责人*/
export function getRouteBatchDetailsUserList(params) {
  return request({
    url: '/distribution/googleRouteBatch/getRouteBatchDetailsUserList',
    params
  })
}

/**查询行程列表*/
export function getRouteBatchDetailsList(params) {
  return request({
    url: '/distribution/googleRouteBatch/getRouteBatchDetailsList',
    params
  })
}


/**设置行程负责人*/
export function setRouteUser(data) {
  return request({
    url: '/distribution/googleRouteBatch/setRouteUser',
    method: 'POST',
    data
  })
}


/**自配送路线配送-删除包裹*/
export function deleteGoogleRouteShipments(id) {
  return request({
    url: `/distribution/googleRouteShipments/${id}`,
    method: 'DELETE',
  })
}


/**自派送修改批次-查询包裹列表*/
export function getGoogleRouteShipmentsList(params) {
  return request({
    url: '/distribution/googleRouteShipments/getGoogleRouteShipmentsList',
    params
  })
}


/**自派送路线设置车辆*/
export function setVehicle(data) {
  return request({
    url: '/distribution/googleVehicle/setVehicle',
    method: 'post',
    data
  })
}



/**打印面单*/
export function printShipments(params) {
  return request({
    url: '/distribution/googleRouteShipments/printShipments',
    params
  })
}
